package com.klun.concDesign.chapterFive;

/**
 * 单例模式
 */
public class LazySingleton {
    private LazySingleton(){
        System.out.println("被创建");
    }
    private static LazySingleton instance = null;

    public static synchronized LazySingleton getInstance(){
        if(instance == null) {
            instance = new LazySingleton();
        }
        return instance;
    }
    // String
    // Double

}
